#include <iostream>

using namespace std;
int a[10000],b[10000],c[10000];
int main()
{
    freopen("color.in","r",stdin);
    freopen("color.out","w",stdout);
    int t,m,n,o;
    cin>>t;
    cin>>m;
    for(int i=0;i<m;i++){
            cin>>a[i];
    }
    cin>>n;
        for(int i=0;i<n;i++){
            cin>>b[i];
    }
    cin>>o;
        for(int i=0;i<o;i++){
            cin>>c[i];
    }
    cout<<"1"<<endl<<"0"<<endl<<"8";
    fclose(stdin);
    fclose(stdout);
    return 0;
}
